﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Symbology;
using DotSpatial.Topology;

namespace PoemsSystem
{
    public class DrawTracks
    {
        public struct Track
        {
            public float year;
            public String nstart;
            public String nend;
            public Coordinate pstart;
            public Coordinate pend;
        }
        public struct Location
        {
            public String anc_name;
            public String cur_name;
            public Coordinate location;
        }
        public static void DrawData(SqlDataReader reader,List<Track> tracks)
        {
            //读取reader内的数据，直接绘图
            //绘多少个取决于reader里的数据量
            Track track = new Track();
            int i = 0;
            while(reader.Read())
            {
                track.year = float.Parse(reader[0].ToString());
                track.nstart = reader[1].ToString();
                track.nend = reader[2].ToString();
                track.pstart = new Coordinate();
                track.pend = new Coordinate();
                track.pstart.X = double.Parse(reader[3].ToString());
                track.pstart.Y = double.Parse(reader[4].ToString());
                track.pend.X = double.Parse(reader[5].ToString());
                track.pend.Y = double.Parse(reader[6].ToString());
                tracks.Add(track);
            }
            reader.Close();
        }
    }
}
